<template>
    <div class="messageBox">
      <div class="weui-panel weui-panel_access">

        <div class="weui-panel__bd">
          <div class="weui-media-box weui-media-box_text" v-for="(item,index) in list" @click="getDetail(item.id)">
            <div>
              <h4 class="weui-media-box__title">{{item.content}}</h4>
              <p class="weui-media-box__desc">创建时间:{{item. createTime}}</p>
            </div>
            <span style="color: rgb(61,176,243)" v-if="item.status==0">处理中</span>
            <span style="color:rgba(0, 0, 0, 0.3)" v-if="item.status==1">已处理</span>
          </div>

        </div>

      </div>
    </div>
</template>

<script>
    export default {
        name: "index",
        data(){
            return {
                list:[]
            }
        },
      onPullDownRefresh(){
        this.getlist()
        // wx.stopPullDownRefresh();
        // wx.hideLoading()

      },
        onShow(){
			wx.setNavigationBarTitle({
			    title: '回复列表'
			})
          this.getlist()
        },
        methods:{
            getlist(){
                let userId = wx.getStorageSync('userId')
                this.$http.request({
                    method: 'get',
                    url: `/api/callCenter/list`,
                    body: {
                        userId:userId
                    }
                }).then((data)=>{
                    if(data.code==200){
                      wx.stopPullDownRefresh();
                      wx.hideLoading()
                       this.list=data.data;
                    }
                })
            },
            getDetail(id){
                wx.navigateTo({ url: '/pages/messageDetail/main?id='+id })
            }
        }
    }
</script>

<style scoped>
   .messageBox .weui-media-box{
     display: flex;
     justify-content: space-between;
     align-items: center;
   }
</style>
